jeeps/gpsusbcommon.h \
jeeps/gpsusbint.h \
jeeps/gpsutil.h \
- logging.h \
magellan.h \
mapsend.h \
navilink.h \
zlib/zconf.in.h \
zlib/zlib.h \
zlib/zutil.h \
- src/core/xmlstreamwriter.h
+ src/core/xmlstreamwriter.h \
+ src/core/logging.h
SUBDIRS += jeeps
#include "cet_util.h"
#include "garmin_fs.h"
#include "garmin_tables.h"
-#include "logging.h"
+#include "src/core/logging.h"
#include <math.h>
#include <QtCore/QXmlStreamReader>
static QXmlStreamReader* reader;
static void
gpx_end(const QString& el)
{
- int pos = current_tag.lastIndexOf('/');
- QString s = current_tag.mid(pos + 1);
float x;
int passthrough;
static QDateTime gc_log_date;
tag_type tag;
- if (s.compare(el)) {
-// TODO: I don't think this is necesary with QXmlStreamReader
- fprintf(stderr, "Mismatched tag %s. Expected %s\n", CSTR(el), qPrintable(s));
- }
-
tag = get_tag(current_tag, &passthrough);
switch (tag) {
/*
+++ /dev/null
-/*
- Copyright (C) 2014 Robert Lipe, robertlipe+source@gpsbabel.org
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111 USA
-
- */
-#ifndef gpsbabel_logging_h_included
-#define gpsbabel_logging_h_included
-
-// A wrapper for QTextStream that provides a sensible Warning() and Fatal()
-// with convenient stream operators.
-
-#include <QtCore/QTextStream>
-#include <QtCore/QFile>
-
-class Warning {
- public:
- Warning(bool fatal = false) :
- fatal_(fatal) {
- file_.open(stderr, QIODevice::WriteOnly);
- fileStream_.setDevice(&file_);
- }
- ~Warning() {
- fileStream_ << '\n';
- if (fatal_) {
- fileStream_.flush();
- exit(1);
- }
- }
- inline Warning& operator << (char d) { fileStream_ << d; return optionalSpace(); }
- inline Warning& operator << (signed short d) { fileStream_ << d; return optionalSpace(); }
- inline Warning& operator << (unsigned short d) { fileStream_ << d; return optionalSpace(); }
- inline Warning& operator << (signed int d) { fileStream_ << d; return optionalSpace(); }
- inline Warning& operator << (unsigned int d) { fileStream_ << d; return optionalSpace(); }
- inline Warning& operator << (signed long d) { fileStream_ << d; return optionalSpace(); }
- inline Warning& operator << (unsigned long d) { fileStream_ << d; return optionalSpace(); }
- inline Warning& operator << (qint64 d) { fileStream_ << d; return optionalSpace(); }
- inline Warning& operator << (quint64 d) { fileStream_ << d; return optionalSpace(); }
- inline Warning& operator << (float d) { fileStream_ << d; return optionalSpace(); }
- inline Warning& operator << (double d) { fileStream_ << d; return optionalSpace(); }
- inline Warning& operator << (const char* d) { fileStream_ << QString::fromUtf8(d); return optionalSpace(); }
- inline Warning& operator << (QString d) { fileStream_ << '\"' << d << '\"'; return optionalSpace(); }
- inline Warning& operator << (const void* d) { fileStream_ << '\"' << d << '\"'; return optionalSpace(); }
-
- inline Warning& optionalSpace() {
- fileStream_ << ' ';
- return *this;
- }
-private:
- QFile file_;
- QTextStream fileStream_;
- bool fatal_;
-};
-
-class Fatal : public Warning {
- public:
- Fatal() : Warning(true) {}
-};
-
-#endif // gpsbabel_logging_h_included
{
char buff[MAXUSRSTRINGSIZE + 1];
int text_len;
- time_t waypt_time;
- short waypt_type;
wpt_tmp->latitude = lat_mm_to_deg(gbfgetint32(file_in));
wpt_tmp->longitude = lon_mm_to_deg(gbfgetint32(file_in));
wpt_tmp->description = buff;
}
/* Time is number of seconds since Jan. 1, 2000 */
- waypt_time = gbfgetint32(file_in);
+ time_t waypt_time = gbfgetint32(file_in);
if (waypt_time) {
wpt_tmp->SetCreationTime(base_time_secs + waypt_time);
}
}
/* Waypoint Type (USER, TEMPORARY, POINT_OF_INTEREST) */
- waypt_type = gbfgetint16(file_in);
+ short waypt_type = gbfgetint16(file_in);
if (global_opts.debug_level >= 1) {
printf(MYNAME " parse_waypt: waypt_type = %d\n",waypt_type);
}
--- /dev/null
+/*
+ Copyright (C) 2014 Robert Lipe, robertlipe+source@gpsbabel.org
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111 USA
+
+ */
+#ifndef gpsbabel_logging_h_included
+#define gpsbabel_logging_h_included
+
+// A wrapper for QTextStream that provides a sensible Warning() and Fatal()
+// with convenient stream operators.
+
+#include <QtCore/QTextStream>
+#include <QtCore/QFile>
+
+class Warning {
+ public:
+ Warning(bool fatal = false) :
+ fatal_(fatal) {
+ file_.open(stderr, QIODevice::WriteOnly);
+ fileStream_.setDevice(&file_);
+ }
+ ~Warning() {
+ fileStream_ << '\n';
+ if (fatal_) {
+ fileStream_.flush();
+ exit(1);
+ }
+ }
+ inline Warning& operator << (char d) { fileStream_ << d; return optionalSpace(); }
+ inline Warning& operator << (signed short d) { fileStream_ << d; return optionalSpace(); }
+ inline Warning& operator << (unsigned short d) { fileStream_ << d; return optionalSpace(); }
+ inline Warning& operator << (signed int d) { fileStream_ << d; return optionalSpace(); }
+ inline Warning& operator << (unsigned int d) { fileStream_ << d; return optionalSpace(); }
+ inline Warning& operator << (signed long d) { fileStream_ << d; return optionalSpace(); }
+ inline Warning& operator << (unsigned long d) { fileStream_ << d; return optionalSpace(); }
+ inline Warning& operator << (qint64 d) { fileStream_ << d; return optionalSpace(); }
+ inline Warning& operator << (quint64 d) { fileStream_ << d; return optionalSpace(); }
+ inline Warning& operator << (float d) { fileStream_ << d; return optionalSpace(); }
+ inline Warning& operator << (double d) { fileStream_ << d; return optionalSpace(); }
+ inline Warning& operator << (const char* d) { fileStream_ << QString::fromUtf8(d); return optionalSpace(); }
+ inline Warning& operator << (QString d) { fileStream_ << '\"' << d << '\"'; return optionalSpace(); }
+ inline Warning& operator << (const void* d) { fileStream_ << '\"' << d << '\"'; return optionalSpace(); }
+
+ inline Warning& optionalSpace() {
+ fileStream_ << ' ';
+ return *this;
+ }
+private:
+ QFile file_;
+ QTextStream fileStream_;
+ bool fatal_;
+};
+
+class Fatal : public Warning {
+ public:
+ Fatal() : Warning(true) {}
+};
+
+#endif // gpsbabel_logging_h_included
#include "grtcirc.h"
#include "garmin_fs.h"
#include "session.h"
-
-#include <logging.h>
+#include "src/core/logging.h"
#if NEWQ
QList<Waypoint*> waypt_list;